<?php
echo '	function box($field, $value, $fieldinfo) {
		$setting = string2array($fieldinfo[\'setting\']);
		if($value==\'\') $value = $this->fields[$field][\'defaultvalue\'];
		$options = explode("\\n",$this->fields[$field][\'options\']);
		foreach($options as $_k) {
			$v = explode("|",$_k);
			$k = trim($v[1]);
			$option[$k] = $v[0];
		}
		$values = explode(\',\',$value);
		$value = array();
		foreach($values as $_k) {
			if($_k != \'\') $value[] = $_k;
		}
		$value = implode(\',\',$value);

		switch($this->fields[$field][\'boxtype\']) {
			case \'radio\':
				$string = form::radio($option,$value,"name=\'info[$field]\'",$setting[\'width\'],$field);
			break;

			case \'checkbox\':
				$string = form::checkbox($option,$value,"name=\'info[$field][]\'",1,$setting[\'width\'],$field);
			break;

			case \'select\':
				$string = form::select($option,$value,"name=\'info[$field]\' id=\'$field\'");
			break;

			case \'multiple\':
				$string = form::select($option,$value,"name=\'info[$field][]\' id=\'$field\' size=2 multiple=\'multiple\' style=\'height:60px;\'");
			break;
		}
		return $string;
	}

?>